package com.xxx.sso.ctrl;

import com.xxx.sso.base.BaseCtrl;
import com.xxx.sso.base.BaseService;
import com.xxx.sso.entity.Permission;
import com.xxx.sso.service.PermissionService;
import com.xxx.sso.util.Result;
import com.xxx.sso.util.ResultBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author caiwl
 * @date 2020/5/11 16:36
 */
@RestController
@RequestMapping("/permission")
public class PermissionCtrl extends BaseCtrl<Permission> {
    @Autowired
    private PermissionService permissionService;

    @GetMapping("/tree")
    public Result tree() {
        return ResultBuilder.okWithObj(permissionService.tree());
    }

    @Override
    public BaseService<Permission> service() {
        return permissionService;
    }
}
